﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Plexi.Science
{
	public class RockData
	{
		public CelestialBody OriginBody { get; set; }
		public RockType Type { get; set; }
		public int BiomeIndex { get; set; }
		public string BiomeName { get; set; }
		public float Mass { get; set; }

		public void SetBiomeName()
		{
			BiomeName = OriginBody.FindBiomeName(BiomeIndex);
		}

		public void DrawWindow(int winid)
		{
			GUILayout.BeginVertical();
			GUILayout.Label(string.Format("Type: {0}", Type.Name));
			if (Type.Class != RockClassifications.Ice)
				GUILayout.Label(string.Format("Classification: {0}", Type.Class));
			GUILayout.Label(string.Format("Mass: {0}t", Mass));
			GUILayout.Label(string.Format("Specific weight: {0}", Type.SpecificWeight));
			GUILayout.Label(string.Format("Discovery location: {0} of {1}", BiomeName.ToLower(), OriginBody.bodyName));
			if (GUILayout.Button("Close"))
				SurfaceRockSpawner.SelectedRockData = null;
			GUILayout.EndVertical();
			GUI.DragWindow();
		}
	}
}
